<template>
    <div>
        <!-- 面包屑导航 -->
        <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>密钥管理</el-breadcrumb-item>
        </el-breadcrumb>
        <el-card>
            <!-- <div class="whole-flex-center-between whole-top-handle">
                <div class="member-list-clear">
                      搜索选项区域
                </div>
            </div> -->
            <div class="whole-flow-table-box">
                <el-table :data="keyList" style="width: 100%" stripe border>
                    <el-table-column align="center" type="selection" width="40"></el-table-column>
                    <el-table-column align="center" prop="user_id" label="UID" width="60"></el-table-column>
                    <el-table-column align="center" prop="appid" label="APPID" ></el-table-column>
                    <el-table-column align="center" prop="sign_key" label="sign_key"></el-table-column>
                    <el-table-column align="center" prop="num" label="状态" width="60">
                        <template slot-scope="scope">
                            <i v-if="scope.row.status==1" style="color:#1989fa;" class="el-icon-success"></i>
                            <i v-else-if="scope.row.status==2" style="color:#F56C6C;" class="el-icon-error"></i>
                        </template>
                    </el-table-column>
                </el-table>
                <div class="whole-pagination">
                    <el-pagination :page-size="size" background layout="prev, pager, next" :total="count"  @current-change="currentPage"></el-pagination>
                </div>
            </div>
        </el-card>
    </div>
</template>
<script>
export default {
    data() {
        return {
            keyList: [],
            count: 100,
            size: 8,
            page: 1,
        };
    },
    created() {
        this.getKeyList(this.page);
    },
    methods: {
        aaa(id) {
            console.log(id);
        },
        // 获取密钥列表
        getKeyList(page) {
            let _this = this;
            this.$axios({
                url: "/admin/master/getUserKey",
                data: {
                    offset: page,
                    limit: this.size,
                },
                success(res) {
                    console.log(res)
                    if (res.data.code == 200) {
                        _this.keyList = res.data.content.data;
                        _this.count = Number(res.data.content.count);
                    } else {
                        _this.$message.error(res.data.msg);
                    }
                },
            });
        },
        currentPage(page) {
            // if (_this.statusValue == undefined) {
            //     sta = 0;
            // } else {
            //     sta = _this.orderExcelStatus;
            // }
            this.getKeyList(page);
        },
    },
};
</script>
<style scoped>
.a {
    vertical-align: middle;
}
</style>